<template>
	<view class="page">

		<view class="lists" v-for="item in lists" :key="item.cl_id">
			<view class="info">
				<view>
					<text class="title">{{item.name}} </text>
					<text class="title"> {{item.mobile}}</text>
				</view>
				<view class="address">
					<text>{{item.full_address}}</text>
				</view>
			</view>
			<view class="count">
				<text class="number">{{item.order_sum}}</text>
				<text class="text">订单数</text>
			</view>
			<view class="count">
				<text class="number">{{item.order_money_sum}}</text>
				<text class="text">销售额</text>
			</view>
			<text class="status" :style="{backgroundColor:getColor(item.status)}">待审核</text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				lists: [],
			}
		},
		onLoad(option) {
			this.getUsers(option.id);
		},
		methods: {
			getColor(status) {
				let colors = ['#ff9900', '#19be6b', '#fa3534', '#909399']
				return colors[status]
			},
			getUsers(id) {
				this.$api.sendRequest({
					url: '/api/member/getLeaderByPartnerId',
					data: {
						id: id
					},
					success: res => {
						console.log(res);
						this.lists = res.data

					}
				})
			}
		}
	}
</script>

<style lang="scss">
	.page {
		background-color: #F8F8F8;
		padding: 30rpx;
	}

	.lists {
		background-color: #FFFFFF;
		border-radius: 10rpx;
		box-shadow: 0 0 4rpx 4rpx #EEEEEE;
		margin-bottom: 20rpx;
		display: flex;
		flex-direction: row;
		align-items: center;
		padding: 20rpx;
		overflow: hidden;
		position: relative;

		.info {
			flex: 1;

			.title {
				font-size: 28rpx;
				color: #303133;
			}

			.address {
				white-space: nowrap;
				text-overflow: ellipsis;
				overflow: hidden;
				font-size: 24rpx;
				color: #606266;
			}
		}

		.count {
			display: flex;
			flex-direction: column;

			.number {
				width: 100rpx;
				font-size: 36rpx;
				color: #000000;
				font-weight: 900;
			}

			.text {
				color: #CCCCCC;
				font-size: 20rpx;
			}
		}


		.status {
			position: absolute;
			right: -75rpx;
			top: 10rpx;
			background-color: #CCCCCC;
			color: #FFFFFF;
			width: 200rpx;
			font-size: 20rpx;
			text-align: center;
			transform: rotate(45deg);
		}
	}
</style>
